Создайте класс Soda (для определения типа газированной воды), принимающий 1 аргумент при инициализации (отвечающий за добавку к выбираемому лимонаду). В этом классе реализуйте метод show_my_drink(), выводящий на печать «Газировка и {ДОБАВКА}» в случае наличия добавки, а иначе отобразится следующая фраза: «Обычная газировка».
При решении задания можно дополнительно проверить тип передаваемого аргумента: принимается только строка.
Решение: class Soda: def __init__(self, ingredient=None): if isinstance(ingredient, str): self.ingredient = ingredient else: self.ingredient = None
def show_my_drink(self): if self.ingredient: print(f'Газировка и {self.ingredient}') else: print('Обычная газировка')
Создайте класс Soda (для определения типа газированной воды), принимающий 1 аргумент при инициализации (отвечающий за добавку к выбираемому лимонаду). В этом классе реализуйте метод show_my_drink(), выводящий на печать «Газировка и {ДОБАВКА}» в случае наличия добавки, а иначе отобразится следующая фраза: «Обычная газировка».
При решении задания можно дополнительно проверить тип передаваемого аргумента: принимается только строка.
Решение: class Soda: def __init__(self, ingredient=None): if isinstance(ingredient, str): self.ingredient = ingredient else: self.ingredient = None
def show_my_drink(self): if self.ingredient: print(f'Газировка и {self.ingredient}') else: print('Обычная газировка')
Свой вариант решения в комментарии 💬
#задачи
BY Python Turbo. Уютное сообщество Python разработчиков.
Telegram and Signal Havens for Right-Wing Extremists
Since the violent storming of Capitol Hill and subsequent ban of former U.S. President Donald Trump from Facebook and Twitter, the removal of Parler from Amazon’s servers, and the de-platforming of incendiary right-wing content, messaging services Telegram and Signal have seen a deluge of new users. In January alone, Telegram reported 90 million new accounts. Its founder, Pavel Durov, described this as “the largest digital migration in human history.” Signal reportedly doubled its user base to 40 million people and became the most downloaded app in 70 countries. The two services rely on encryption to protect the privacy of user communication, which has made them popular with protesters seeking to conceal their identities against repressive governments in places like Belarus, Hong Kong, and Iran. But the same encryption technology has also made them a favored communication tool for criminals and terrorist groups, including al Qaeda and the Islamic State.
How To Find Channels On Telegram?
There are multiple ways you can search for Telegram channels. One of the methods is really logical and you should all know it by now. We’re talking about using Telegram’s native search option. Make sure to download Telegram from the official website or update it to the latest version, using this link. Once you’ve installed Telegram, you can simply open the app and use the search bar. Tap on the magnifier icon and search for a channel that might interest you (e.g. Marvel comics). Even though this is the easiest method for searching Telegram channels, it isn’t the best one. This method is limited because it shows you only a couple of results per search.
Python Turbo Уютное сообщество Python разработчиков from ua